/*
 * ShowImageWindow.java
 *
 * Created on September 16, 2007, 10:52 PM
 * 
 * Copyright 2008 David D. Emory
 * 
 * This file is part of Five Points. See <http://www.fpdev.org> for
 * additional information regarding the project.
 * 
 * Five Points is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Five Points is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Five Points.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.fpdev.apps.admin.gui;

import java.awt.GridLayout;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

/**
 *
 * @author demory
 */
public class ShowImageWindow extends JFrame {

  /** Creates a new instance of ShowImageWindow */
  public ShowImageWindow(BufferedImage img) {
    super("Image");

    //JPanel imgPanel = new JPanel();
    //imgPanel.setSize(img.getWidth(), img.getHeight());
    //imgPanel.getGraphics().drawImage(img,0,0,imgPanel);
    JScrollPane scrollPane = new JScrollPane();
    JPanel imgPanel = new ImagePanel(img);
    imgPanel.setSize(img.getWidth(), img.getHeight());
    //scrollPane.add(imgPanel);
    //scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

    getContentPane().setLayout(new GridLayout(1, 1));
    getContentPane().add(imgPanel);//scrollPane);
    pack();
    setSize(400, 250);
    setVisible(true);

  }
}
